import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * 枚举类型单例
 */
public enum SingleTonEnmu {
    INSTANCE;
}
class EnumTest{
    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
//        SingleTonEnmu instance = SingleTonEnmu.INSTANCE;
//        SingleTonEnmu instance1 = SingleTonEnmu.INSTANCE;
//        System.out.println(instance == instance1);
        Constructor<SingleTonEnmu> declaredConstructor = SingleTonEnmu.class.getDeclaredConstructor(String.class, int.class);
        declaredConstructor.setAccessible(true);
        SingleTonEnmu instance = declaredConstructor.newInstance("INSTANCE", 0);

    }
}
